package taskTracker.ui.lite;

import javax.microedition.lcdui.Command;

import taskTracker.util.Setting;

/**
 * Displays settings to the user so that he can view or edit them.
 * @author aseldawy
 *
 */
public class CategoryChooser extends List {
	
	/**Command to return back*/
	private final Command cmdBack = new Command("Back", Command.BACK, 1);
	
	private Setting[] settings;

	public CategoryChooser(Setting[] settings) {
		super("Settings", List.IMPLICIT);
		for (int i = 0; i < settings.length; i++) {
			if (!settings[i].type.equals("hidden") &&
					super.indexOf(settings[i].category) == -1) {
				super.append((Object)settings[i].category, null);
			}
		}
		this.settings = settings;
		super.addCommand(cmdBack);
	}

	public Setting[] getSettings() {
		return settings;
	}
	
}
